<div ms-controller="group" class="col-md-9">
    <h1>小组管理</h1>

    <div class="right">
        <form class="form-inline" onsubmit="return false;">
            <div class="form-group-sm">
                <label>搜索</label>
                <input class="form-control" placeholder="请输入关键词" ms-duplex="keyword">
                <input type="submit" value="搜索" class="btn btn-primary" ms-click="search()">
            </div>
        </form>
    </div>
    <table class="table table-striped">
        <tr>
            <th>ID</th>
            <th>名称</th>
            <th>创建时间</th>

            <th>人数</th>
            <th>设置</th>
            <th></th>
        </tr>
        <tr ms-repeat="groupList">
            <td>{{ el.id }}</td>
            <td>{{ el.name }}</td>
            <td>{{ el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
            <td>{{ el.members_number }}</td>
            <td>{{ getGroupSettingString(el.join_group_setting) }}</td>

            <td>
                <button class="btn-sm btn-info" ms-click="showGroupDetailPage(el.id)">详情</button>
            </td>
        </tr>
    </table>

    <div class="right">
        页数：{{ page }}/{{ totalPage }}&nbsp;&nbsp;
        <button ms-attr-class="getBtnClass('pre')" ms-click="getPrevious">上一页</button>
        <button ms-attr-class="getBtnClass('next')" ms-click="getNext">下一页</button>
    </div>
    <h2>创建小组</h2>
    <form id="add-group-form">
        <div class="col-md-12">
            <div class="form-group"><label>小组名</label>
                <input type="text" name="name" class="form-control" ms-duplex="name"
                        data-error="请填写小组名(名称不能超过20字)" maxlength="20" required>
                <div class="help-block with-errors"></div>
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group"><label>描述</label>
                <textarea rows="3" name="description" class="form-control" ms-duplex="description"
                          data-error="请填写描述" maxlength="300" required>
                </textarea>
                <div class="help-block with-errors"></div>
            </div>
        </div>
        
        <div class="col-md-12">
            <div class="form-group">
                <label>加入小组设置</label>
                <input type="radio" name="join_group_setting" value="0" ms-duplex-string="group_type">允许任何人加入
                <input type="radio" name="join_group_setting" value="1" ms-duplex-string="group_type">提交请求后管理员审核
                <input type="radio" name="join_group_setting" value="2" ms-duplex-string="group_type">不允许任何人加入

            </div>
            <input type="submit" class="btn btn-success btn-lg" value="创建小组" id="submitBtn">
        </div>
    </form>

</div>
<script src="/static/js/app/admin/group/group.js"></script>